Excel VBA: The Ultimate Beginner's Guide to Learn VBA Programming Step by Step by David A. Williams

Excel VBA: The Ultimate Beginner's Guide to Learn VBA Programming Step by Step by David A. Williams

Author:David A. Williams [A. Williams, David]
Language: eng
Format: azw3
Published: 2019-06-09T16:00:00+00:00


p: This is not a character that is d, e or f.

Y: This is any character.

6: This is a digit.

X: This is the letter X.

You can now say that the pattern for both strings is the same.

Let us look at a code that will show you a variety of results when you use the same pattern:

Sub Patterns()

​ ' This will print true

​ Debug.Print 1; "apY6X" Like "[abc][!def]?#X*"

​ ' This will print true since any combination is valid after X

​ Debug.Print 2; "apY6Xsf34FAD" Like "[abc][!def]?#X*"

​ ' This will print false since the character is not a, b or c

​ Debug.Print 3; "dpY6X" Like "[abc][!def]?#X*"

​ ' This will print false since the character is one of d, e and f

​ Debug.Print 4; "aeY6X" Like "[abc][!def]?#X*"

​ ' This will print false since the character at 4 should be a digit.

​ Debug.Print 5; "apYAX" Like "[abc][!def]?#X*"

​ ' This will print false since the character at position 5 should be X.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.